extern crate rustc_serialize;

pub mod gitosc;
pub mod github;
pub mod bitbucket;

use std::convert::AsRef;
use std::process::Command;
use std::str;

// helper to execute a shell command.
pub fn exec_command(cmd: &str) {
    let output = Command::new(cmd).output().unwrap_or_else(|e| {
        panic!("failed to execute process: {}", e);
    });
    println!("output:\n{}", str::from_utf8(output.stdout.as_ref()).unwrap());
}

#[cfg(test)]
mod hooktest {
    use super::exec_command;

    #[test]
    fn test() {
        exec_command("ls");
    }
}
